#include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
int main()
{
	int n,a[4]={},b=1;
	scanf("%d",&n);
    a[0]=n%10;
	for (int i=1;i<4;i++){
		b=b*10;
		a[i]=(n/b)%10;
	}
	for(int i=0;i<4;i++){
		a[i]+=9;
		a[i]=a[i]%10;
	}
	a[1]^=a[3];a[3]^=a[1];a[1]^=a[3];
	a[0]^=a[2];a[2]^=a[0];a[0]^=a[2];
	printf("The encrypted number is %d%d%d%d", a[3], a[2], a[1], a[0]);
    return 0;
}
//数字加密